/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.com.minam.beans;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alvaro
 */
@Entity
@Table(name = "TPROVINCIAS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tprovincias.findAll", query = "SELECT t FROM Tprovincias t"),
    @NamedQuery(name = "Tprovincias.findByCodiDepaDpt", query = "SELECT t FROM Tprovincias t WHERE t.tprovinciasPK.codiDepaDpt = :codiDepaDpt"),
    @NamedQuery(name = "Tprovincias.findByCodiProvTpr", query = "SELECT t FROM Tprovincias t WHERE t.tprovinciasPK.codiProvTpr = :codiProvTpr"),
    @NamedQuery(name = "Tprovincias.findByNombProvTpr", query = "SELECT t FROM Tprovincias t WHERE t.nombProvTpr = :nombProvTpr")})
public class Tprovincias implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected TprovinciasPK tprovinciasPK;
    @Size(max = 50)
    @Column(name = "NOMB_PROV_TPR")
    private String nombProvTpr;

    public Tprovincias() {
    }

    public Tprovincias(TprovinciasPK tprovinciasPK) {
        this.tprovinciasPK = tprovinciasPK;
    }

    public Tprovincias(String codiDepaDpt, String codiProvTpr) {
        this.tprovinciasPK = new TprovinciasPK(codiDepaDpt, codiProvTpr);
    }

    public TprovinciasPK getTprovinciasPK() {
        return tprovinciasPK;
    }

    public void setTprovinciasPK(TprovinciasPK tprovinciasPK) {
        this.tprovinciasPK = tprovinciasPK;
    }

    public String getNombProvTpr() {
        return nombProvTpr;
    }

    public void setNombProvTpr(String nombProvTpr) {
        this.nombProvTpr = nombProvTpr;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tprovinciasPK != null ? tprovinciasPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tprovincias)) {
            return false;
        }
        Tprovincias other = (Tprovincias) object;
        if ((this.tprovinciasPK == null && other.tprovinciasPK != null) || (this.tprovinciasPK != null && !this.tprovinciasPK.equals(other.tprovinciasPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.com.minam.beans.Tprovincias[ tprovinciasPK=" + tprovinciasPK + " ]";
    }
    
}
